package com.chinatelecom.ifree.business.domain.vote;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class VoteFactory {
	public static HashMap<Integer, List<VoteItem>> voteItemMap;

	static {
		voteItemMap = new HashMap<Integer, List<VoteItem>>();
		// 初始化投票的选项
		List<VoteItem> itemList = new ArrayList<VoteItem>();

		itemList.add(new VoteItem(1, VoteEnum.WHY_CHOOSE_IFREE.getId(), "运营商终于流量不清零了", 1));
		itemList.add(new VoteItem(2, VoteEnum.WHY_CHOOSE_IFREE.getId(), "路过勿理", 1));
		itemList.add(new VoteItem(3, VoteEnum.WHY_CHOOSE_IFREE.getId(), "一切为了信号", 1));
		itemList.add(new VoteItem(4, VoteEnum.WHY_CHOOSE_IFREE.getId(), "支持运营商的首次突破", 1));
		itemList.add(new VoteItem(5, VoteEnum.WHY_CHOOSE_IFREE.getId(), "可煲电话粥啦", 1));
		itemList.add(new VoteItem(6, VoteEnum.WHY_CHOOSE_IFREE.getId(), "0月租还包邮", 1));
		itemList.add(new VoteItem(7, VoteEnum.WHY_CHOOSE_IFREE.getId(), "追求自由无约束", 1));
		itemList.add(new VoteItem(8, VoteEnum.WHY_CHOOSE_IFREE.getId(), "想买七折流量包", 1));
		itemList.add(new VoteItem(9, VoteEnum.WHY_CHOOSE_IFREE.getId(), "本地本网通话免费", 1));

		voteItemMap.put(VoteEnum.WHY_CHOOSE_IFREE.getId(), itemList);
	}

	public static boolean voteExists(int voteid) {
		VoteEnum[] va = VoteEnum.values();
		for (int i = 0; i < va.length; i++) {
			if (va[i].getId() == voteid) {
				return true;
			}
		}
		return false;
	}
}
